package com.dg.river.netty.axle.msg2dev;

import io.netty.channel.Channel;

/**
 * 设备签到后，记录设备信息、类型以及socket信息
 */
public class DevSession {
    /**设备类型：未知*/
    public static final short DEVTYPE_NONE = 0;
    /**设备类型：车轴*/
    public static final short DEVTYPE_AXLE = 1;
    /**设备类型：稽查平板*/
    public static final short DEVTYPE_AUDIT = 2;

    /**设备编码*/
    private String devId;

    /**设备类型: 0:未知; 1:车轴设备; 2:稽查平板*/
    private short devType;

    /***/
    private Channel channel;

    public String getDevId() {
        return devId;
    }

    public void setDevId(String devId) {
        this.devId = devId;
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DevSession padInfo = (DevSession) o;

        return devId.equals(padInfo.devId);
    }

    @Override
    public int hashCode() {
        return devId.hashCode();
    }

    public short getDevType() {
        return devType;
    }

    public void setDevType(short devType) {
        this.devType = devType;
    }
}
